<?php get_header(); ?>

	<div id="main">

		<?php if (have_posts()) : ?>
		
			<?php $post = $posts[0]; // Hack. Set $post so that the_date() works. ?>
			
			<?php if (is_category()) { ?>				
			<h3 class="pagetitle">Archives for the '<?php echo single_cat_title(); ?>' Category</h3>
			
			<?php } elseif (is_day()) { ?>
			<h3 class="pagetitle">Archives for <?php the_time('F jS, Y'); ?></h3>
			
			<?php } elseif (is_month()) { ?>
			<h3 class="pagetitle">Archives for <?php the_time('F, Y'); ?></h3>
			
			<?php } elseif (is_year()) { ?>
			<h3 class="pagetitle">Archives for <?php the_time('Y'); ?></h3>
			
			<?php } elseif (is_search()) { ?>
			<h3 class="pagetitle">Search Results</h3>
			
			<?php } elseif (is_author()) { ?>
			<h3 class="pagetitle">Author Archives</h3>
			
			<?php } elseif (isset($_GET['paged']) && !empty($_GET['paged'])) { ?>
			<h3 class="pagetitle">Blog Archives</h3>
			
			<?php } ?>
			
			<?php while (have_posts()) : the_post(); ?>
					<h2 id="post-<?php the_ID(); ?>"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h2>
					
					<?php the_content('Continue reading this post &raquo;') ?>
					
					<?php if (function_exists('the_tags')) { ?>
						<p class="tags"><?php the_tags('',', ',''); ?></p>
					<?php } ?>
					
					<p class="meta">
						<span class="cal"><a href="<?php bloginfo('url'); ?>/<?php the_time('Y') ?>/<?php the_time('m') ?>/" title="View all posts for the month of <?php the_time('F, Y') ?>"><?php the_time('m/d/Y') ?></a></span> | 
						<span class="cat"><?php the_category(', ') ?></span> |
						<span class="com"><?php comments_popup_link('No Comments', '1 Comment', '% Comments'); ?></span>
						<?php edit_post_link('Edit','| ',''); ?>
					</p>
			<?php endwhile; ?>
			
				<ul class="postnav">
					<li class="left"><?php next_posts_link('&laquo; Earlier Posts') ?>&nbsp;</li>
					<li class="right">&nbsp;<?php previous_posts_link('Later Posts &raquo;') ?></li>
				</ul>
			
		<?php else : ?>
			
			<h2 class="center">Not Found</h2>
			<p>Hmm... Nothing was found...</p>
			
		<?php endif; ?>
	</div>

<?php get_sidebar(); ?>

<?php get_footer(); ?>